import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace ArtistScheduleApi {
  /** 化妆师档期信息 */
  export interface ArtistSchedule {
    id: number; // 
    artistCode?: string; // 化妆师编码
    serviceDate?: string | Dayjs; // 服务日期
    timeSlot: string; // 时间段
    isBooked: number; // 是否已预约
    bookingId: string; // 预约ID
  }
}

/** 查询化妆师档期分页 */
export function getArtistSchedulePage(params: PageParam) {
  return requestClient.get<PageResult<ArtistScheduleApi.ArtistSchedule>>('/wedding/artist-schedule/page', { params });
}

/** 查询化妆师档期详情 */
export function getArtistSchedule(id: number) {
  return requestClient.get<ArtistScheduleApi.ArtistSchedule>(`/wedding/artist-schedule/get?id=${id}`);
}

/** 新增化妆师档期 */
export function createArtistSchedule(data: ArtistScheduleApi.ArtistSchedule) {
  return requestClient.post('/wedding/artist-schedule/create', data);
}

/** 修改化妆师档期 */
export function updateArtistSchedule(data: ArtistScheduleApi.ArtistSchedule) {
  return requestClient.put('/wedding/artist-schedule/update', data);
}

/** 删除化妆师档期 */
export function deleteArtistSchedule(id: number) {
  return requestClient.delete(`/wedding/artist-schedule/delete?id=${id}`);
}


/** 导出化妆师档期 */
export function exportArtistSchedule(params: any) {
  return requestClient.download('/wedding/artist-schedule/export-excel', { params });
}

